{"ast":null,"code":"var _jsxFileName = \"/data/messenger.client/src/components/DialogInput/index.tsx\";\nimport React from \"react\";\nimport { IconButton, TextField } from \"@mui/material\";\nimport classNames from \"classnames\";\nimport data from '@emoji-mart/data';\nimport Picker from '@emoji-mart/react';\nimport { UploadFiles } from \"../../components\";\nimport './DialogInput.scss';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\nconst DialogInput = _ref => {\n  var _uploaded$items;\n  let {\n    toggleEmojiPicker,\n    emojiPickerVisible,\n    setEmojiPickerVisible,\n    value,\n    textField,\n    setTextField,\n    maxSizeMessage,\n    uploadDocumentHandler,\n    handleSendMessage,\n    pickerRef,\n    addEmoji,\n    flagForStyle,\n    textAreaRef,\n    uploaded\n  } = _ref;\n  return /*#__PURE__*/_jsxDEV(\"div\", {\n    className: \"dialogInput\",\n    children: [((_uploaded$items = uploaded.items) === null || _uploaded$items === void 0 ? void 0 : _uploaded$items.length) > 0 && /*#__PURE__*/_jsxDEV(\"div\", {\n      className: \"dialogInput-upload\",\n      style: !flagForStyle ? {\n        bottom: `100px`\n      } : {\n        bottom: `117px`\n      },\n      children: /*#__PURE__*/_jsxDEV(UploadFiles, {\n        uploaded: uploaded\n      }, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 38,\n        columnNumber: 25\n      }, this)\n    }, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 31,\n      columnNumber: 21\n    }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n      className: \"dialogInput-form\",\n      children: [/*#__PURE__*/_jsxDEV(\"div\", {\n        ref: pickerRef,\n        className: \"dialogInput-emoji\",\n        children: [/*#__PURE__*/_jsxDEV(IconButton, {\n          type: \"button\",\n          className: \"dialogInput-form-smile\",\n          onClick: () => toggleEmojiPicker()\n        }, void 0, false, {\n          fileName: _jsxFileName,\n          lineNumber: 43,\n          columnNumber: 25\n        }, this), emojiPickerVisible && /*#__PURE__*/_jsxDEV(\"div\", {\n          style: !flagForStyle ? {\n            bottom: `90px`\n          } : {\n            bottom: `117px`\n          },\n          className: \"dialogInput__emoji-picker\",\n          children: /*#__PURE__*/_jsxDEV(Picker, {\n            onEmojiSelect: emojiData => {\n              addEmoji(emojiData.native);\n            },\n            set: \"apple\",\n            theme: \"light\",\n            locale: \"ru\",\n            data: data\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 56,\n            columnNumber: 33\n          }, this)\n        }, void 0, false, {\n          fileName: _jsxFileName,\n          lineNumber: 49,\n          columnNumber: 29\n        }, this)]\n      }, void 0, true, {\n        fileName: _jsxFileName,\n        lineNumber: 42,\n        columnNumber: 21\n      }, this), /*#__PURE__*/_jsxDEV(TextField, {\n        className: classNames(\"dialogInput-form-input\", {\n          \"dialogInput-form-input--error\": textField.length > maxSizeMessage\n        }),\n        onChange: e => setTextField(e.target.value),\n        onKeyUp: e => {\n          if (e.key === 'Enter') {\n            handleSendMessage();\n            setEmojiPickerVisible(false);\n          }\n        },\n        value: textField,\n        variant: \"outlined\",\n        label: textField.length > 0 && `${textField.length}/${maxSizeMessage}` || null,\n        multiline: true,\n        rows: flagForStyle ? 3 : 1,\n        placeholder: \"\\u0412\\u0432\\u0435\\u0434\\u0438\\u0442\\u0435 \\u0441\\u043E\\u043E\\u0431\\u0449\\u0435\\u043D\\u0438\\u0435\",\n        inputProps: {\n          'aria-label': 'Введите сообщение'\n        },\n        inputRef: textAreaRef\n      }, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 79,\n        columnNumber: 21\n      }, this), /*#__PURE__*/_jsxDEV(IconButton, {\n        type: \"button\",\n        className: \"dialogInput-form-image\",\n        children: /*#__PURE__*/_jsxDEV(\"input\", {\n          type: \"file\",\n          accept: \"image/*\",\n          multiple: true,\n          onChange: e => uploadDocumentHandler(e)\n        }, void 0, false, {\n          fileName: _jsxFileName,\n          lineNumber: 103,\n          columnNumber: 25\n        }, this)\n      }, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 99,\n        columnNumber: 21\n      }, this), value && /*#__PURE__*/_jsxDEV(IconButton, {\n        type: \"button\",\n        className: \"dialogInput-form-send\"\n      }, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 112,\n        columnNumber: 29\n      }, this) || /*#__PURE__*/_jsxDEV(IconButton, {\n        type: \"button\",\n        className: \"dialogInput-form-microphone\"\n      }, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 116,\n        columnNumber: 26\n      }, this)]\n    }, void 0, true, {\n      fileName: _jsxFileName,\n      lineNumber: 41,\n      columnNumber: 17\n    }, this)]\n  }, void 0, true, {\n    fileName: _jsxFileName,\n    lineNumber: 29,\n    columnNumber: 13\n  }, this);\n};\n_c = DialogInput;\nexport default DialogInput;\nvar _c;\n$RefreshReg$(_c, \"DialogInput\");","map":{"version":3,"names":["React","IconButton","TextField","classNames","data","Picker","UploadFiles","DialogInput","toggleEmojiPicker","emojiPickerVisible","setEmojiPickerVisible","value","textField","setTextField","maxSizeMessage","uploadDocumentHandler","handleSendMessage","pickerRef","addEmoji","flagForStyle","textAreaRef","uploaded","items","length","bottom","emojiData","native","e","target","key"],"sources":["/data/messenger.client/src/components/DialogInput/index.tsx"],"sourcesContent":["import React from \"react\";\nimport {IconButton, TextField} from \"@mui/material\";\nimport classNames from \"classnames\";\nimport data from '@emoji-mart/data'\nimport Picker from '@emoji-mart/react'\nimport {DialogInputProps} from \"../../models/props/DialogInputProps\";\nimport {UploadFiles} from \"../../components\";\nimport './DialogInput.scss';\n\nconst DialogInput: React.FC<DialogInputProps> = (\n    {\n        toggleEmojiPicker,\n        emojiPickerVisible,\n        setEmojiPickerVisible,\n        value,\n        textField,\n        setTextField,\n        maxSizeMessage,\n        uploadDocumentHandler,\n        handleSendMessage,\n        pickerRef,\n        addEmoji,\n        flagForStyle,\n        textAreaRef,\n        uploaded\n    }\n) => {\n    return (\n            <div className=\"dialogInput\">\n                {uploaded.items?.length > 0 &&\n                    <div className=\"dialogInput-upload\"\n                         style={\n                             !flagForStyle?\n                                 {bottom: `100px`}:\n                                 {bottom: `117px`}\n                         }\n                    >\n                        <UploadFiles uploaded={uploaded} />\n                    </div>\n                }\n                <div className=\"dialogInput-form\">\n                    <div ref={pickerRef} className=\"dialogInput-emoji\">\n                        <IconButton\n                            type=\"button\"\n                            className='dialogInput-form-smile'\n                            onClick={() => toggleEmojiPicker()}\n                        />\n                        {emojiPickerVisible && (\n                            <div\n                                style={\n                                    !flagForStyle?\n                                        {bottom: `90px`}:\n                                        {bottom: `117px`}\n                                }\n                                className=\"dialogInput__emoji-picker\">\n                                <Picker\n                                    onEmojiSelect={\n                                        (emojiData: {\n                                            id: string;\n                                            name: string;\n                                            /** emoji */\n                                            native: string;\n                                            /** unicode */\n                                            unified: string;\n                                            keywords: string[];\n                                            shortcodes: string;\n                                        }) => {\n                                            addEmoji(emojiData.native);\n                                        }\n                                    }\n                                    set=\"apple\"\n                                    theme=\"light\"\n                                    locale=\"ru\"\n                                    data={data}\n                                />\n                            </div>\n                        )}\n                    </div>\n                    <TextField\n                        className={classNames(\"dialogInput-form-input\", {\n                            \"dialogInput-form-input--error\": textField.length > maxSizeMessage\n                        })}\n                        onChange={e => (setTextField(e.target.value))}\n                        onKeyUp={e => {\n                            if (e.key === 'Enter') {\n                                handleSendMessage();\n                                setEmojiPickerVisible(false);\n                            }\n                        }}\n                        value={textField}\n                        variant=\"outlined\"\n                        label={((textField.length > 0 && `${textField.length}/${maxSizeMessage}`) || null)}\n                        multiline\n                        rows={flagForStyle? 3: 1}\n                        placeholder=\"Введите сообщение\"\n                        inputProps={{ 'aria-label': 'Введите сообщение' }}\n                        inputRef={textAreaRef}\n                    />\n                    <IconButton\n                        type=\"button\"\n                        className='dialogInput-form-image'\n                    >\n                        <input\n                            type=\"file\"\n                            accept=\"image/*\"\n                            multiple={true}\n                            onChange={e => uploadDocumentHandler(e)}\n                        />\n                    </IconButton>\n                    {\n                        (value &&\n                            <IconButton\n                                type=\"button\"\n                                className='dialogInput-form-send'\n                            />) ||\n                        (<IconButton\n                            type=\"button\"\n                            className='dialogInput-form-microphone'\n                        />)\n                    }\n                </div>\n            </div>\n    );\n}\n\nexport default DialogInput;"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAQC,UAAU,EAAEC,SAAS,QAAO,eAAe;AACnD,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,IAAI,MAAM,kBAAkB;AACnC,OAAOC,MAAM,MAAM,mBAAmB;AAEtC,SAAQC,WAAW,QAAO,kBAAkB;AAC5C,OAAO,oBAAoB;AAAC;AAE5B,MAAMC,WAAuC,GAAG,QAiB3C;EAAA;EAAA,IAhBD;IACIC,iBAAiB;IACjBC,kBAAkB;IAClBC,qBAAqB;IACrBC,KAAK;IACLC,SAAS;IACTC,YAAY;IACZC,cAAc;IACdC,qBAAqB;IACrBC,iBAAiB;IACjBC,SAAS;IACTC,QAAQ;IACRC,YAAY;IACZC,WAAW;IACXC;EACJ,CAAC;EAED,oBACQ;IAAK,SAAS,EAAC,aAAa;IAAA,WACvB,oBAAAA,QAAQ,CAACC,KAAK,oDAAd,gBAAgBC,MAAM,IAAG,CAAC,iBACvB;MAAK,SAAS,EAAC,oBAAoB;MAC9B,KAAK,EACD,CAACJ,YAAY,GACT;QAACK,MAAM,EAAG;MAAM,CAAC,GACjB;QAACA,MAAM,EAAG;MAAM,CACvB;MAAA,uBAEF,QAAC,WAAW;QAAC,QAAQ,EAAEH;MAAS;QAAA;QAAA;QAAA;MAAA;IAAG;MAAA;MAAA;MAAA;IAAA,QACjC,eAEV;MAAK,SAAS,EAAC,kBAAkB;MAAA,wBAC7B;QAAK,GAAG,EAAEJ,SAAU;QAAC,SAAS,EAAC,mBAAmB;QAAA,wBAC9C,QAAC,UAAU;UACP,IAAI,EAAC,QAAQ;UACb,SAAS,EAAC,wBAAwB;UAClC,OAAO,EAAE,MAAMT,iBAAiB;QAAG;UAAA;UAAA;UAAA;QAAA,QACrC,EACDC,kBAAkB,iBACf;UACI,KAAK,EACD,CAACU,YAAY,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